package com.ling.pl.autoproject.definition.dao;

import com.ling.pl.core.commons.constant.TableColnumDef;
import com.ling.pl.core.commons.utils.AssertHelper;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author bo.wang
 */
@Component(ProjectDao.BEAN_ID)
public class ProjectDao extends BaseProjectDao {
    protected void buildProjectQuery(StringBuffer query, Map values, Map params) {
        query.append(" from ProjectEntity where 1=1 ");
        Object value = params.get("flag");
        if (AssertHelper.notEmpty(value)) {
            query.append(" and flag=:flag");
            values.put("flag", value);
        } else {
            query.append(" and flag=:flag");
            values.put("flag", TableColnumDef.FLAG_EFFECT);
        }
        if (AssertHelper.notEmpty(TableColnumDef.FILTER_NAME_PATTERN)) {
            //			query.append(" and status=:status");
            //			values.put("status", value);
        }
    }
}

